#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    char a[100000];
    gets(a);
    int e=0,b=0,c=0,i;
    for(i=0;i<strlen(a);i++)
    {
        if((a[i]>='A'&&a[i]<='Z')||(a[i]>='a'&&a[i]<='z'))e++;
        if(a[i]>='0'&&a[i]<='9')b++;
        if((a[i]>=33&&a[i]<=47)||(a[i]>=58&&a[i]<=64)||(a[i]>=91&&a[i]<=96)||(a[i]>=123&&a[i]<=126))c++;
    }
    printf("%d %d %d %d",e,b,strlen(a)-e-b-c,c);
    return 0;
}
